const tenantId = JSON.parse(localStorage.getItem("saber-tenantId")).content;

export const userColumn = [
	{
		label: "工号",
		prop: "code",
		align: "center",
		display: false,
		fixed: "left"
	},
	{
		label: "登录账号",
		prop: "account",
		search: true,
		display: false,
		hide: true
	},
	{
		label: "用户姓名",
		prop: "realName",
		search: true,
		display: false,
		align: "center",
		fixed: "left"
	},
	{
		label: "性别",
		prop: "sex",
		type: "select",
		width: 60,
		dicData: [{
			label: "男",
			value: 1
		}, {
			label: "女",
			value: 2
		}],
		align: "center",
		display: false
	},
	{
		label: "身份证号",
		prop: "sfzh",
		align: "center",
		display: false,
		width: 160
	},
	{
		label: "部门",
		prop: "deptName",
		align: "center",
		display: false,
		width: 100
	},
	{
		label: "岗位名称",
		prop: "postId",
		align: "center",
		display: false,
		width: 100,
		search: true,
		type: "select",
		dicUrl: "/api/blade-system/post/select?tenantId=" + tenantId,
		props: {
			label: "postName",
			value: "id",
		},
	},
	{
		label: "手机号码",
		prop: "phone",
		align: "center",
		display: false,
		width: 110
	},
	{
		label: "人员类别",
		prop: "rylb",
		align: "center",
		display: false,
		type: "select",
		dicUrl: "/api/blade-system/dict-biz/dictionary?code=user_type",
		props: {
			label: "dictValue",
			value: "dictKey",
		}
	},
	{
		label: "人员状态",
		prop: "ryzt",
		type: "select",
		dicData: [{
			label: "在职",
			value: 1
		}, {
			label: "离职",
			value: 0
		}],
		align: "center",
		display: false,
		search: true,
		width: 80,
		slot: true
	},
	{
		label: "二维码",
		prop: "ewm",
		align: "center",
		display: false,
		slot: true,
		width: 110
	},
	{
		label: "工卡",
		prop: "gkContent",
		align: "center",
		display: false,
		slot: true
	},
	{
		label: "电量",
		prop: "power",
		align: "center",
		display: false,
		slot: true
	},
	{
		label: "绑卡",
		prop: "bindCard",
		align: "center",
		slot: true,
		display: false,
		width: 100
	}
]

export const detailInfoGroup = {
	label: "详细信息",
	prop: "detailInfo",
	icon: "el-icon-s-order",
	column: [
		{
			label: "用户昵称",
			prop: "name",
			hide: true,
			rules: [{
				required: true,
				message: "请输入用户昵称",
				trigger: "blur"
			}]
		},
		{
			label: "用户姓名",
			prop: "realName",
			rules: [{
				required: true,
				message: "请输入用户姓名",
				trigger: "blur"
			}, {
				min: 2,
				max: 5,
				message: "姓名长度在2到5个字符"
			}]
		},
		{
			label: "手机号码",
			prop: "phone",
		},
		{
			label: "电子邮箱",
			prop: "email",
			hide: true,
		},
		{
			label: "性别",
			prop: "sex",
			type: "select",
			dicData: [{
				label: "男",
				value: 1
			}, {
				label: "女",
				value: 2
			}],
			rules: [{
				required: true,
				message: "请选择性别",
				trigger: "change"
			}]
		},
		{
			label: "出生日期",
			type: "date",
			prop: "birthday",
			format: "yyyy-MM-dd",
			valueFormat: "yyyy-MM-dd",
			rules: [{
				required: true,
				message: "请选择出生日期",
				trigger: "blur"
			}]
		},
		{
			label: "人员类别",
			prop: "rylb",
			type: "select",
			dicUrl: "/api/blade-system/dict-biz/dictionary?code=user_type",
			props: {
				label: "dictValue",
				value: "dictKey",
			},
			rules: [{
				required: true,
				message: "请选择人员类别",
				trigger: "change"
			}]
		},
		{
			label: "身份证号",
			prop: "sfzh",
			rules: [{
				required: true,
				message: "请输入身份证号",
				trigger: "blur"
			}]
		},
		{
			label: "进入本单位日期",
			prop: "jrbdwrq",
			type: "date",
			format: "yyyy-MM-dd",
			valueFormat: "yyyy-MM-dd",
			rules: [{
				required: true,
				message: "请选择进入本单位日期",
				trigger: "blur"
			}]
		},
		{
			label: "婚姻状况",
			prop: "hyzk",
			type: "select",
			dicData: [{
				label: "未婚",
				value: 0
			}, {
				label: "已婚",
				value: 1
			}, {
				label: "离异",
				value: 2
			}],
			rules: [{
				required: true,
				message: "请选择婚姻状况",
				trigger: "change"
			}]
		},
		{
			label: "最高学历",
			prop: "zgxl",
			type: "select",
			dicUrl: "/api/blade-system/dict-biz/dictionary?code=highest_education",
			props: {
				label: "dictValue",
				value: "dictKey",
			}
		},
		{
			label: "最高学位",
			prop: "zgxw"
		},
		{
			label: "毕业院校",
			prop: "zhbyyx"
		},
		{
			label: "政治面貌",
			prop: "zzmm"
		},
		{
			label: "籍贯",
			prop: "jg"
		},
		{
			label: "民族",
			prop: "mz"
		},
		{
			label: "专业",
			prop: "zy"
		},
		{
			label: "办公电话",
			prop: "bgdh"
		},
		{
			label: "职称",
			prop: "zc"
		},
		{
			label: "职称证书号",
			prop: "zczsbh"
		},
		{
			label: "工龄（年）",
			prop: "gl",
			type: "number",
			minRows: 0.1,
			maxRows: 99.9,
			step: 0.1,
			precision: 1
		},
		{
			label: "是否3年以上化工行业从业经历",
			prop: "sf3nyshghycyjl",
			type: "select",
			dicData: [{
				label: "是",
				value: 1
			}, {
				label: "否",
				value: 0
			}]
		},
		{
			label: "毕业证书号",
			prop: "byzsh"
		},
		{
			label: "注册安全工程师证号",
			prop: "zcaqgcsh"
		},
		{
			label: "从业所在地",
			prop: "cyszd"
		},
		{
			label: "户籍所在地",
			prop: "jgszd"
		},
		{
			label: "工作职责",
			prop: "gzzz",
			type: "textarea",
			span: 24,
			maxlength: 150
		},
		{
			label: "工作经历",
			prop: "gzjl1",
			type: "textarea",
			span: 24,
			maxlength: 150
		},
		{
			label: "备注",
			prop: "bz",
			type: "textarea",
			span: 24,
			maxlength: 150
		},
		{
			label: "责任区域",
			prop: "zrqy",
			type: "textarea",
			span: 24,
			maxlength: 150
		}
	]
}

export const dutyInfoGroup = {
	label: "职责信息",
	prop: "dutyInfo",
	icon: "el-icon-s-custom",
	column: [
		{
			label: "工号",
			prop: "code",
			rules: [{
				required: true,
				message: "请输入工号",
				trigger: "blur"
			}]
		},
		{
			label: "所属角色",
			prop: "roleId",
			multiple: true,
			type: "tree",
			dicData: [],
			props: {
				label: "title"
			},
			checkStrictly: true,
			slot: true,
			rules: [
				{
					required: true,
					message: "请选择所属角色",
					trigger: "click"
				}
			]
		},
		{
			label: "所属部门",
			prop: "deptId",
			type: "tree",
			dicData: [],
			props: {
				label: "title"
			},
			checkStrictly: true,
			slot: true,
			rules: [
				{
					required: true,
					message: "请选择所属部门",
					trigger: "click"
				}
			]
		},
		{
			label: "所属岗位",
			prop: "postId",
			type: "select",
			dicUrl: "/api/blade-system/post/select?tenantId=" + tenantId,
			props: {
				label: "postName",
				value: "id",
			},
			rules: [
				{
					required: true,
					message: "请选择所属岗位",
					trigger: "click"
				}
			]
		}
	]
}

export const enclosureInfoGroup = {
	label: "附件信息",
	prop: "enclosureInfo",
	icon: "el-icon-paperclip",
	column: [
		{
			label: "照片",
			prop: "zp",
			formslot: true
		},
		{
			label: "学历证书",
			prop: "xlzs",
			formslot: true
		},
		{
			label: "附件",
			prop: "fj",
			formslot: true
		},
		{
			label: "工作简历",
			prop: "gzjl2",
			formslot: true
		},
		{
			label: "工卡绑定",
			prop: "gk",
			type: "select",
			dicData: [],
			// dicUrl: "/api/locationCard/locationcardinfo/unbindList",
			props: {
				label: "bqh",
				value: "id",
			}
		}
	]
}

export const platformColumn = [
	{
		label: "登录账号",
		prop: "account",
		search: true,
		display: false
	},
	{
		label: "所属租户",
		prop: "tenantName",
		slot: true,
		display: false
	},
	{
		label: "用户姓名",
		prop: "realName",
		search: true,
		display: false
	},
	{
		label: "用户平台",
		prop: "userTypeName",
		slot: true,
		display: false
	},
	{
		label: "用户平台",
		type: "select",
		dicUrl: "/api/blade-system/dict/dictionary?code=user_type",
		props: {
			label: "dictValue",
			value: "dictKey"
		},
		dataType: "number",
		search: true,
		hide: true,
		display: false,
		prop: "userType",
		rules: [
			{
				required: true,
				message: "请选择用户平台",
				trigger: "blur"
			}
		]
	},
	{
		label: "用户拓展",
		prop: "userExt",
		type: "textarea",
		minRows: 8,
		span: 24,
		row: true,
		hide: true
	}
]

export const exportColumn = [
	{
		label: "模板上传",
		prop: "excelFile",
		type: "upload",
		drag: true,
		loadText: "模板上传中，请稍等",
		span: 24,
		propsHttp: {
			res: "data"
		},
		tip: "请上传 .xls,.xlsx 标准格式文件",
		action: "/api/blade-user/import-userInfoDetail"
	},
	{
		label: "模板下载",
		prop: "excelTemplate",
		formslot: true,
		span: 24
	}
]